#ifndef _HTTPSESSIONINSTANTIATOR_HPP_
#define _HTTPSESSIONINSTANTIATOR_HPP_

#include "jhdefs.hpp"
#include "types.hpp"
#include "net/URI.hpp"
#include <string>

NET_NAMESPACE_BEGIN
class CHTTPClientSession;
class CHTTPSessionInstantiator
{
public:
	CHTTPSessionInstantiator();
	virtual ~CHTTPSessionInstantiator();

	virtual CHTTPClientSession* createClientSession(const CURI& uri);
	static void registerInstantiator();
	static void unregisterInstantiator();

protected:
	void setProxy(const std::string& host, UInt16 port);
	const std::string& proxyHost() const;
	UInt16 proxyPort() const;
	void setProxyCredentials(const std::string& username, const std::string& password);
	const std::string& proxyUsername() const;
	const std::string& proxyPassword() const;

private:
	std::string m_proxyHost;
	UInt16		m_proxyPort;
	std::string m_proxyUsername;
	std::string m_proxyPassword;

	friend class CHTTPSessionFactory;
};

NET_NAMESPACE_END

#endif
